package com.changgou.goods.feign;

import com.changgou.entity.Result;
import com.changgou.goods.pojo.Sku;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;

@FeignClient(name = "goods")
public interface SkuFeign {
    /**
     * 多条件搜索品牌数据
     * @param spuId
     * @return
     */
    @GetMapping("/sku/spu/{spuId}")
    public List<Sku> fingListBySpuId(@PathVariable("spuId")String spuId);

    @GetMapping("/sku/count")
    public Integer countSku();

    @GetMapping("/sku/search/{page}/{size}")
    public Result findPage(@RequestParam Map searchMap, @PathVariable("page")  int page, @PathVariable("size")  int size);

    /**
     * 根据id查询sku信息
     * @param id
     * @return
     */
    @GetMapping("/sku/{id}")
    Result<Sku> findById(@PathVariable("id") String id);
}
